//
//  CollectionViewCell.m
//  TheCollectionView
//
//  Created by ODSdev2 on 15/9/21.
//  Copyright (c) 2015年 liubenwang. All rights reserved.
//

#import "CollectionViewCell.h"

@implementation CollectionViewCell

- (void)awakeFromNib {
    // Initialization code
}
-(void)setWatermodel:(CompanyDetailWaterPullModel *)watermodel
{
    _watermodel = watermodel;

    self.backgroundColor = UIColorFromRGB(0xf6f6f6);

    NSString * str = watermodel.content;
    if ([str heightOfSize:17 width:self.width] == self.width) {

    }
    else
    {
        self.TopImageViews.contentMode =  UIViewContentModeScaleAspectFill;
        self.TopImageViews.clipsToBounds = YES;
        
        self.TopImageViews.autoresizingMask = UIViewAutoresizingFlexibleWidth;
        
        
        NSLog(@"%@",watermodel.pic);
        self.TopImageViews.userInteractionEnabled = YES;

        
        
        NSRange range = [watermodel.pic rangeOfString:@"|"];
        if (range.location != NSNotFound) {            NSArray * arr = [watermodel.pic componentsSeparatedByString:@"|"];
            [self.TopImageViews sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",U76HOURL,arr.firstObject]]];
            NSLog(@"%@",arr.firstObject);
        }
        else
        {
            [self.TopImageViews sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",U76HOURL,watermodel.pic]]];
        }
        
       
        self.BottomLabel.numberOfLines = 1;
        self.BottomLabel.font = [UIFont systemFontOfSize:15];
        self.BottomLabel.textColor = [UIColor grayColor];
        self.BottomLabel.text = str;
        
    }
}

@end
